﻿using System.Web;
using System.Web.UI;
using DreamDriven.ObjectModel.Mvp;

namespace DreamDriven.Web
{
    public abstract class BaseMasterPage : MasterPage, IView, IViewStateControl
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="BaseMasterPage"/> class.
        /// </summary>
        protected BaseMasterPage()
        {
            PresenterBinder.Bind(this);
        }

        public new StateBag ViewState
        {
            get { return base.ViewState; }
        }

        public string CurrentUserName
        {
            get
            {
                return HttpContext.Current.User.Identity.IsAuthenticated
                           ? HttpContext.Current.User.Identity.Name
                           : string.Empty;
            }
        }
    }
}
